import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/admin/Home.vue'

Vue.use(Router)

export default new Router({
    mode: 'history',
    base: process.env.BASE_URL,
    routes: [
        {
            path:'/',
            name:'主页面',
            component:()=>import ('./views/front/Front.vue'),
            redirect:'/home',
            children:[
                {
                    path:'home',
                    name:'home',
                    component:()=>import('./views/front/Home.vue')
                },
                 {
                    path:'articles',
                    name:'articles',
                    component:()=>import('./views/front/Articles.vue')
                },
                {
                    path:'timecourse',
                    name:'timecourse',
                    component:()=>import('./views/front/TimeCourse.vue')
                },
                {
                    path:'message',
                    name:'message',
                    component:()=>import('./views/front/Message.vue')
                }
            ]
        }
        ,
        {
            path:'/admin',
            name:'admin',
            component:()=>import('./views/admin/Home.vue'),
            redirect:'/admin/articles',
            children:[
                {
                    path: 'articles',
                    name: 'admin-articles',
                    component: () => import('./views/admin/Articles.vue')
                },
                {
                    path: 'users',
                    name: 'users',
                    component: () => import('./views/admin/Users.vue')
                },
            ]
        }
    ]
})
